<?php

/**
 * @author Honza
 */
namespace Albireo\Forms;
use Nette\Forms\TextInput;

class TextEmail extends TextInput
{
    /**
     * @param  string  control name
     * @param  string  label
     * @param  int  width of the control
     * @param  int  maximum number of characters the user may enter
     */
    public function __construct($label = NULL, $cols = NULL, $maxLength = NULL)
    {
        parent::__construct($label);
        $this->control->type = 'email';
        $this->control->size = $cols;
        $this->control->maxlength = $maxLength;
        $this->filters[] = callback($this, 'sanitize');
        $this->value = '';
    }
}
